<!DOCTYPE html>
<html>
<head>
  <meta charset=UTF-8>
  <title>管理员登录 - 大学乐游</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
  <link rel="stylesheet" href="/layuiadmin/style/login.css" media="all">
</head>
<body style="background: url(http://yaokui.ltd:8888/1080p);">

  <div class="layadmin-user-login layadmin-user-display-show" id="LAY-user-login" style="display: none;">

    <div class="layadmin-user-login-main">
      <div class="layadmin-user-login-box layadmin-user-login-header">
        <h2>管理员登录</h2>
        <p>大学乐游APP | 管理后台</p>
      </div>
      <div class="layadmin-user-login-box layadmin-user-login-body layui-form">
        <div class="layui-form-item">
          <label class="layadmin-user-login-icon layui-icon layui-icon-username" for="LAY-user-login-username"></label>
          <input type="text" name="login" id="LAY-user-login-username" lay-verify="required" placeholder="用户名" class="layui-input" value="${admin_login}">
        </div>
        <div class="layui-form-item">
          <label class="layadmin-user-login-icon layui-icon layui-icon-password" for="LAY-user-login-password"></label>
          <input type="password" name="pwd" id="LAY-user-login-password" lay-verify="required" placeholder="密码" class="layui-input" value="">
        </div>
        <div class="layui-form-item">
          <div class="layui-row">
            <div class="layui-col-xs7">
              <label class="layadmin-user-login-icon layui-icon layui-icon-vercode" for="LAY-user-login-vercode"></label>
              <input type="text" name="code" id="LAY-user-login-vercode" lay-verify="required" placeholder="图形验证码" class="layui-input">
            </div>
            <div class="layui-col-xs5">
              <div style="margin-left: 10px;">
                <img src="getGifCode" onclick="yzm();" class="layadmin-user-login-codeimg" id="vcode">
              </div>
            </div>
          </div>
        </div>
        <div class="layui-form-item">
          <button class="layui-btn layui-btn-fluid" lay-submit lay-filter="LAY-user-login-submit">登 录</button>
        </div>

      </div>
    </div>
    
    <div class="layui-trans layadmin-user-login-footer">
      
      <p>© 2019 大学乐游</p>
    </div>
    
  </div>

  <script src="/layuiadmin/layui/layui.js" type="text/javascript" charset="utf-8"></script>
  <script>
  layui.use([ 'form','layer'], function(){
    var $ = layui.$
    ,admin = layui.admin
    ,form = layui.form
    ,router = layui.router()
	,layer = layui.layer
    ,search = router.search;

    form.render();

    //提交
    form.on('submit(LAY-user-login-submit)', function(obj){
	
		// //登入成功的提示与跳转
        //
        $.ajax({
            url:"dologin",
            dataType:"json",
            type:"post",
            data:obj.field,
            success:function(result){
                if(result.status=="1") {
                    layer.msg('登入成功', {
                      offset: '15px'
                      ,icon: 1
                      ,time: 1000
                    }, function(){
                      location.href = 'index'; //主页
                    });
                }
                else{
                    layer.msg(result.tips, {
                        offset: '15px'
                        ,time: 3000
                        ,icon:2
                        ,anim:6
                    });
                }

                yzm();
            },
            error:function(result){
                console.log(result);
                alert("系统繁忙！");
            }
        });

    });


      window.yzm = function yzm() {
          $("#vcode").attr("src", "getGifCode?t="+new Date().getTime());
      }


  });
  </script>
</body>
</html>